import Mongoose from "mongoose";
import MovieSchema from "./MovieSchema";
import config from "../../config";

// 数据库连接
Mongoose.connect(config.dbUrl)
const db = Mongoose.connection;

db.on('error', (err) => {
  console.log('数据库连接失败', err);
})

db.once('open', () => {
  console.log('数据库连接成功');
})

export {
  MovieSchema
}